/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.menosehmais.framework.persistence;

import br.com.menosehmais.model.UsuarioDO;
import javax.persistence.*;
import org.hibernate.annotations.*;
import org.joda.time.LocalDateTime;


/**
 *
 * @author Junior JAFJ
 */
@MappedSuperclass
public abstract class ViewDO<DO extends DomainObject> extends DomainObject implements IHaveAccount, IHaveCreationDateTime, IHaveLastUpdate {

    private String referenceId;

    @ManyToOne
    private UsuarioDO conta;

    @Column(updatable = false)
    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
    private LocalDateTime creationDateTime;

    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
    private LocalDateTime lastUpdate;

    @Override
    public LocalDateTime getCreationDateTime() {
        return creationDateTime;
    }

    @Override
    public void setCreationDateTime(LocalDateTime creationDateTime) {
        this.creationDateTime = creationDateTime;
    }

    @Override
    public LocalDateTime getLastUpdate() {
        return lastUpdate;
    }

    @Override
    public void setLastUpdate(LocalDateTime lastUpdate) {
        this.lastUpdate = lastUpdate;
    }

    public UsuarioDO getConta() {
        return conta;
    }

    public void setConta(UsuarioDO conta) {
        this.conta = conta;
    }
    
    public String getReferenceId() {
        return referenceId;
    }

    public void setReferenceId(String referenceId) {
        this.referenceId = referenceId;
    }

}
